package com.example.demo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: H_tao_X
 * Date: 2022-07-21
 * Time: 16:09
 */

// 3.1 默认情况下 返回的是静态页面的名称
//
//@Controller
//@ResponseBody
@RestController // 等于Controller + @ResponseBody
public class TestController {
    @RequestMapping("/sayhi")
    public String sayHi() {
        return "222";
    }
}

